package com.wangjw;

import java.math.BigDecimal;

/**
 * Created by wangjw on 18/5/5.
 */
public class CommonTest {

    public static void main(String[] args) {
//        System.out.println("7.22 - 7.0 = " + test3(7.22, 7.0));
        test4();
    }

    private static void test1() {
        System.out.println("CommonTest");
        System.out.println(Math.sqrt(100));

        String str = "wangjw";
        String str1 = new String("wangjw");
        System.out.println(str.intern() == str1.intern());
    }

    private static void test2() {
        System.out.println("7.22 - 7.0 = " + (7.22f - 7.0f));
    }

    private static double test3(double v1, double v2) {
        BigDecimal b1 = new BigDecimal(Double.toString(v1));
        BigDecimal b2 = new BigDecimal(Double.toString(v2));
        return b1.subtract(b2).doubleValue();
    }

    private static void test4() {
        long time = System.currentTimeMillis();
        System.out.println("time = " + String.valueOf(time));
    }
}